package demo1;

public class TestDemo1 {
    public static void main(String[] args) {
        MyArrayList myArrayList = new MyArrayList(3);
        myArrayList.add(1);
        myArrayList.add(2);
        myArrayList.display();
        System.out.println("======");
        myArrayList.set(1,1);
        myArrayList.display();
        myArrayList.set(2,3);
        myArrayList.display();
        //myArrayList.set(4,3);
        //myArrayList.display();
        System.out.println("======");
        myArrayList.add(0,0);
        myArrayList.display();
        myArrayList.add(3,2);
        myArrayList.display();
        myArrayList.add(5,4);
        myArrayList.display();
        System.out.println("======");
        System.out.println(myArrayList.indexOf(9));
        System.out.println(myArrayList.indexOf(2));
        System.out.println(myArrayList.contains(2));
        System.out.println(myArrayList.contains(9));
        System.out.println("======");
        System.out.println(myArrayList.get(0));
        System.out.println(myArrayList.get(3));
        //System.out.println(myArrayList.get(8));
        System.out.println("======");
        myArrayList.display();
        myArrayList.remove(1);
        myArrayList.display();
        myArrayList.remove(0);
        myArrayList.display();
        myArrayList.remove(111);
        myArrayList.display();
        System.out.println("======");
        System.out.println(myArrayList.size());
        myArrayList.display();
        myArrayList.clear();
        System.out.println(myArrayList.size());
        myArrayList.display();
    }
}
